package d03;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

public class AnnotationTest3 {
    public static void main(String[] args) {
        Class<Demo> demoClass = Demo.class;
        Annotation[] declaredAnnotations = demoClass.getDeclaredAnnotations();
        for (Annotation annotation : declaredAnnotations) {
            System.out.println(demoClass.getName()+"注解 "+ annotation);
        }
        System.out.println("------------------------------------------");
        Method[] declaredMethods = demoClass.getDeclaredMethods();
        for (Method method : declaredMethods) {
            Annotation[] annotations = method.getAnnotations();
            for (Annotation annotation : annotations) {
                System.out.println(method.getName()+"注解"+ annotation);
            }
        }


    }



}
